import request from "@/utils/request";

enum API {
    // 获取用户信息
    CENTER = "/userCenter/users/me?access_token=341cc09c-86c3-4a75-bbb6-37822b51233d",
    // 资源动态
    DYNAMIC = "/moment/moments/collect/dynamic_manager?access_token=341cc09c-86c3-4a75-bbb6-37822b51233d&pageSize=10",
    // 会员产品列表
    MEMBERS = "/setup/setups/search/findByGroupType?access_token=341cc09c-86c3-4a75-bbb6-37822b51233d&groupType=vip_product",
    SKILLS = "/setup/setups/search/findByGroupType?groupType=skill_level&access_token=341cc09c-86c3-4a75-bbb6-37822b51233d",
    AVOCATION = `/avocation/avocations/rec/user?access_token=341cc09c-86c3-4a75-bbb6-37822b51233d&`,
    SEARCH = "/avocation/avocations/search/findByName?access_token=341cc09c-86c3-4a75-bbb6-37822b51233d&name=",
    SAVE = "/userCenter/users/ff80808183d5a6440183e9df981b153a?access_token=341cc09c-86c3-4a75-bbb6-37822b51233d",
}

export interface UserInfo {
    account: string;
    avatar: string;
    avocation: [];
    level: number;
    moreBackup: {};
    statisticsBackup: {};
}

export interface Dynamic {
    content: [];
}

export default {
    reqUserInfo() {
        return request.get<any, UserInfo>(API.CENTER);
    },
    reqDynamic() {
        return request.get<any, Dynamic>(API.DYNAMIC);
    },
    reqMemberList() {
        return request.get<any, any>(API.MEMBERS);
    },
};
